<html>

<head>
    <style type="text/css">
        table.gradienttable {
            font-family: verdana, arial, sans-serif;
            border-width: 3px;
            border-collapse: collapse;
            width: 100%;
        }
        
        table.gradienttable th {
            padding: 3px;
            color: #FFFFFF;
            background: #000066;
            font-size: 12px;
        }
        
        table.gradienttable td {
            padding: 3px;
            color: #000000;
            font-size: 11px;
            background: #ebecda;
            text-align: center;
        }
        
        table.gradienttable th p {
            margin: 3px;
            padding: 9px;
        }
        
        table.gradienttable td p {
            padding: 9px;
        }
    </style>
    <style>

    </style>

    <script>
        function openWeekSummary() {
            // 获取日期选择控件的值
            var date = document.getElementById('mydate').value;

            // 构建目标URL
            var url = '/task/weeksummary?date=' + encodeURIComponent(date);

            // 打开新窗口
            window.open(url, '_blank');
        }

        function refreshFeishu() {
            var selectedMan = document.querySelector('input[name="man"]:checked').value;
            var url = '/task/feishu?man=' + encodeURIComponent(selectedMan);
            window.location.href = url;
        }

        function refreshTapd() {
            var selectedMan = document.querySelector('input[name="man"]:checked').value;
            var url = '/task/tapdtask?man=' + encodeURIComponent(selectedMan);
            window.location.href = url;
        }


        
        function check() {
            // 获取日期选择控件的值
            var date = document.getElementById('mydate').value;

            // 构建目标URL
            var url = '/task/check?date=' + encodeURIComponent(date) + '&force=true';
            window.location.href = url;
        }
    </script>
</head>

<body>
    <style>
        /* 标签页样式 */
        .mainmanue {
            overflow: hidden;
            border: 1px solid #ccc;
            background-color: #f1f1f1;
            text-align: center;
        }
    
        .mainmanue button {
            background-color: inherit;
            float: left;
            border: none;
            outline: none;
            cursor: pointer;
            padding: 14px 16px;
            transition: 0.3s;
        }
    
        .mainmanue button:hover {
            background-color: #ddd;
        }
    
        .mainmanue button.active {
            background-color: #ccc;
        }
    
        .tabcontent {
            display: none;
            padding: 6px 12px;
            border: 1px solid #ccc;
            border-top: none;
        }
    </style>
    <div class="mainmanue" >
        <button class="tablinks" onclick="window.location.href='/task/home'">个人按日任务清单</button>
        <button class="tablinks" onclick="window.location.href='/task/weeksummary'">周任务统计(旧-实时查询)</button>
        <button class="tablinks" onclick="window.location.href='/devreport/list'">周任务统计(新-单据)</button>
        <button class="tablinks" onclick="window.location.href='/story/home'">需求统计</button>
    </div>
    <div style="width:100%;margin-left:auto;margin-right:auto;">
        
        <div style="text-align:right;font-size:2em;">
            <form action="/devreport/list" method="get" style="text-align:left;">
                <p>
                    <label for="begin">开始日期:</label>
                    <input type="date" id="begin" name="begin" value="" required style="font-size:1.5em;">
                    <label for="end">结束日期:</label>
                    <input type="date" id="end" name="end" value="" required style="font-size:1.5em;">
                    <label for="pageNo">页码:</label>
                    <input type="number" name="pageNo" value="#(pageNo)" style="width:4em;"></input>
                    <label for="pageSize">每页记录数:</label>
                    <input type="number" name="pageSize" value="#(pageSize)" style="width:4em;"></input>
                </p>
                <p style="text-align:right;">
                    <button type="button" style="height:5em;width:9em;" onclick="window.open('/devreport/add','_blank')">新的周报</button>&nbsp;
                    <button type="submit" style="height:5em;width:7em;">查询</button>&nbsp;
                </p>
            </form>

            <script>
                // 设置日期输入框的默认值为当天日期
                document.getElementById('begin').value = '#date(begin,"yyyy-MM-dd")';
                document.getElementById('end').value = '#date(end,"yyyy-MM-dd")';
            </script>
        </div>
        <div style="margin-top:2em;margin-bottom:2em;">
            <table class="gradienttable" border="1" style="width:100%;line-height:2em;">
                <tr>
                    <th style="width:5em;">ID</th>
                    <th style="width:3em;">状态</th>
                    <th style="width:5em;">结转日期</th>
                    <th style="width:2em;">类型</th>
                    <th style="width:11em;">开始时间</th>
                    <th style="width:11em;">结束时间</th>
                    <th style="width:4em;">开发成本</th>
                    <th style="width:3em;">天数</th>
                    <th style="width:5em;">应产出工时</th>
                    <th style="width:6em;">总应产出工时</th>
                    <th style="width:6em;">TAPD人数</th>
                    <th style="width:6em;">TAPD工时</th>
                    <th style="width:6em;">TAPD效率</th>
                    <th style="width:5em;">飞书人数</th>
                    <th style="width:5em;">飞书工时</th>
                    <th style="width:5em;">飞书效率</th>
                    <th style="width:8em;">紧急未完成任务</th>
                    <th style="width:5em;">未分配开发</th>
                    <th style="width:5em;">未标记需求</th>
                </tr>
                #for(x:datas)
                    <tr>
                        <td><a href="/devreport/show?id=#(x.sID)" target="_blank">#(x.sID)</a></td>
                        <td>#if(x.sStatus??)#if(x.sStatus>2) 锁定 #else 编辑 #end#end</td>
                        <td>#date(x.xDateTime, "yyyy-MM-dd")</td>
                        <td>#(x.xDataType)</td>
                        <td>#date(x.xBeginTime, "yyyy-MM-dd HH:mm:ss")</td>
                        <td>#date(x.xEndTime, "yyyy-MM-dd HH:mm:ss")</td>
                        <td>#number(x.xCost, "0.#")</td>
                        <td>#number(x.xDayCnt, "0.#")</td>
                        <td>#number(x.xHours, "0.#")</td>
                        <td>#number(x.xTotalHour, "0.#")</td>
                        <td>#number(x.xTapdEmplCnt, "0.#")</td>
                        <td>#number(x.xTapdHour, "0.#")</td>
                        <td>#number(x.xTapdRate, "0.#")</td>
                        <td>#number(x.xFeishuEmplCnt, "0.#")</td>
                        <td>#number(x.xFeishuHour, "0.#")</td>
                        <td>#number(x.xFeishuRate, "0.#")</td>
                        <td>#number(x.xEmergencyCnt, "0.#")</td>
                        <td>#number(x.xWaitingTaskCnt, "0.#")</td>
                        <td>#number(x.xWaitingCloseTaskCnt, "0.#")</td>
                    </tr>
                #end
            </table>
        </div>
    </div>
</body>
</html>